/******************************************************************************
 *      Mestrado em Ciência da Computação - UFMS
 *		Redes de Computadores - Prof. Dr. Ronaldo Alves Ferreira
 *		Alunos: Geraldo Landre, Marcel Tolentino, Vinícius Bueno
 *****************************************************************************/
/* tcpkilltimers.c - tcpkilltimers */

#include "tcb.h"
#include "tcpfms.h"
#include "defines.h"
#include "my_socket.h"
#include "tcptimer.h"
/*------------------------------------------------------------------------
 *  tcpkilltimers - mata todos os temporizadores pendentes para um (for a) TCB
 *------------------------------------------------------------------------
 */
int tcpkilltimers(struct tcb *ptcb)
{
    int tcbnum = ptcb->tcb_dvnum;

    /* clear all possible pending timers */

    tmclear(thread_getport(output_thread), MKEVENT(SEND, tcbnum));
    tmclear(thread_getport(output_thread), MKEVENT(RETRANSMIT, tcbnum));
    tmclear(thread_getport(output_thread), MKEVENT(PERSIST, tcbnum));
    return OK;
}
